package com.gzx.plugin.data.wckj.mapper;

import com.gzx.plugin.data.wckj.entity.JudgeRepayPlanInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WckjJudgeRepayPlanInfoDao {
    @Insert("<script>" +
            "INSERT INTO data_wckj_hhjh " +
            "(ywyh_id, load_no, loan_key, period, due_date, " +
            "due_amount, due_principal, due_interest, due_service_fee, " +
            "due_other_fee, guarantee_fee, overdue_service_fee, overdue_interest, " +
            "create_time, update_time) " +
            "VALUES " +
            "<foreach collection='judgeRepayPlanInfoList' item='wckjHhjh' separator=','>" +
            "(" +
            "#{wckjHhjh.ywyhId}, " +
            "#{wckjHhjh.loanNo}, " +
            "#{wckjHhjh.loanKey}, " +
            "#{wckjHhjh.period}, " +
            "#{wckjHhjh.dueDate}, " +
            "#{wckjHhjh.dueAmount}, " +
            "#{wckjHhjh.duePrincipal}, " +
            "#{wckjHhjh.dueInterest}, " +
            "#{wckjHhjh.dueServiceFee}, " +
            "#{wckjHhjh.dueOtherFee}, " +
            "#{wckjHhjh.guaranteeFee}, " +
            "#{wckjHhjh.overdueServiceFee}, " +
            "#{wckjHhjh.overdueInterest}, " +
            "now(), " +   // 数据库生成时间
            "now()" +
            ")" +
            "</foreach>" +
            "</script>")
    void batchSave(@Param("judgeRepayPlanInfoList") List<JudgeRepayPlanInfo> judgeRepayPlanInfoList);
}
